/**
 * @author: Nghia Ho
 */
<?php $base_url =  base64_decode($_GET['base_url']);?>
base_url = '<?php echo $base_url;?>';
function thickBoxGallery(callback){
	tb_show('Pictures','<?php echo $base_url;?>admin/gallery_management.html?width=1300&height=500&callback='+callback);
}
function initEditor(name){
	if (CKEDITOR.instances[name] != undefined)
		{
			CKEDITOR.remove(CKEDITOR.instances[name]);
		}
	var editor = CKEDITOR.replace( name,
													{
													 	filebrowserBrowseUrl : '<?php echo $base_url;?>public/skin/back-end/js/ckfinder/ckfinder.html',
													 	filebrowserImageBrowseUrl : '<?php echo $base_url;?>public/skin/back-end/js/ckfinder/ckfinder.html?type=Images',
													 	filebrowserFlashBrowseUrl : '<?php echo $base_url;?>public/skin/back-end/js/ckfinder/ckfinder.html?type=Flash',
													 	filebrowserUploadUrl : '<?php echo $base_url;?>public/skin/back-end/js/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Files',
													 	filebrowserImageUploadUrl : '<?php echo $base_url;?>public/skin/back-end/js/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Images',
													 	filebrowserFlashUploadUrl : '<?php echo $base_url;?>public/skin/back-end/js/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Flash'
													 }
	 										);			
	CKFinder.setupCKEditor( editor, '<?php echo $base_url;?>public/skin/back-end/js/ckfinder/' ) ;
}
$(document).ready(function(){ 
    $('.dateField').datepicker({ 
		dateFormat: 'yy-mm-dd',
		changeMonth: true,
		changeYear: true,
		yearRange: 'c-10:c+10'
	});
});